package com.web.exiaodao.business.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.web.exiaodao.business.entity.FanliBusiness;


public interface FanliBusinessRepository extends
		PagingAndSortingRepository<FanliBusiness, Long>,
		JpaSpecificationExecutor<FanliBusiness> {
	public FanliBusiness findByIdAndStatusNot(Long id,Integer status);
	//根据中文名字查询
	public FanliBusiness findByBusinessNameAndStatusNot(String businessName,Integer status);
	//根据英文名字查询
	public FanliBusiness findByBusinessEnNameAndStatusNot(String businessEnName,Integer status);
	//查询商家名列表
	@Query(value="SELECT * FROM `tb_xa_fanlibusiness` WHERE STATUS<>?1 ORDER BY create_time DESC",nativeQuery=true)
	public List<FanliBusiness> findBusinessNameListByStatusNot(Integer status); 
}
